package com.welike.shibo.config;

import cn.jpush.api.JPushClient;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @author fangyu
 * @version v1.0.0
 * @since 2019-09-01 12:58
 */

@Configuration
@ConfigurationProperties
public class JiGuanConfig {

    // 极光官网-个人管理中心-appkey
//    @Value("${push.appkey}")
//    private String appKey = "c60e0835cc2f24a23fc8e582";
    private String appKey = "8f4c300226515089e7bb61a9";

    // 极光官网-个人管理中心-点击查看-secret
//    @Value("${push.secret}")
//    private String secret = "b8fa7bd2914770146cbb8797";
    private String secret = "864c2844cfa6adaa1cc7aa6f";

    private JPushClient jPushClient;

    // 推送客户端
    @PostConstruct
    public void initJPushClient(){
        jPushClient = new JPushClient(secret, appKey);
    }

    // 获取推送客户端
    public JPushClient getJPushClient(){
        return jPushClient;
    }
}
